﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;

namespace AgileToDo.Common
{
    [ValueConversion(typeof(DateTime?), typeof(Brush))]
    public class DateTime2BrushConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {

            var dateTime = (DateTime?)value;

            if (dateTime.HasValue)
                return ColorHelper.FinishedBackColor;

            return ColorHelper.DefaultBackColor;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }

    }
}
